//
//  TextNewsCell.swift
//  MyTest
//
//  Created by guanzhongwang on 2021/4/20.
//

import UIKit

class TextNewsCell: BaseTableViewCell {
    private let titleLabel = UILabel()
   
    let bottomView = NewsCellBottomView()

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        contentView.addSubview(titleLabel)
        titleLabel.font = Font_Size_14
        titleLabel.numberOfLines = 3
        titleLabel.snp.makeConstraints({
            $0.top.equalTo(15)
            $0.left.equalTo(15)
            $0.right.equalToSuperview().inset(15)
        })
        
        contentView.addSubview(bottomView)
        bottomView.snp.makeConstraints({
            $0.left.equalTo(15)
            $0.top.equalTo(titleLabel.snp.bottom)
            $0.right.equalToSuperview().inset(15)
            $0.bottom.equalToSuperview()
        })
       
    }
    func bind(item:NewsModel) {
        titleLabel.text = item.title
        bottomView.updateContent(item: item)
    }
   
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
